<!--
  ~ Copyright 2021 Scheer PAS Schweiz AG
  ~
  ~  Licensed under the Apache License, Version 2.0 (the "License");
  ~  you may not use this file except in compliance with the License.
  ~  You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~  Unless required by applicable law or agreed to in writing, software
  ~  distributed under the License is distributed on an "AS IS" BASIS,
  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~  See the License for the specific language governing permissions and
  ~  imitations under the License.
  -->

<mat-card id="policy-card" *ngIf="policy">
  <mat-card-header>
    <mat-icon id="policy-card-icon" mat-card-avatar color="primary">{{
      policy.icon
    }}</mat-icon>
    <mat-card-title id="policy-card-title">{{
      'POLICIES.' + policy.definition.id + '.TITLE' | translate
    }}</mat-card-title>
  </mat-card-header>
  <mat-card-content *ngIf="policy.headers">
    <p
      id="policy-description"
      [innerHTML]="
        'POLICIES.' + policy.definition.id + '.DESCRIPTION'
          | translate: policy.restrictions
      "></p>
    <p id="policy-header-info">
      {{ 'POLICIES.' + policy.definition.id + '.MORE_INFO' | translate }}
    </p>
    <ul id="policy-header-list">
      <li id="policy-header-limit">
        <b id="policy-header-limit-name">{{ policy.headers.headerLimit }}:</b>
        {{ 'POLICIES.' + policy.definition.id + '.LIMIT' | translate }}
      </li>
      <li id="policy-header-remaining">
        <b id="policy-header-remaining-name"
          >{{ policy.headers.headerRemaining }}:</b
        >
        {{ 'POLICIES.' + policy.definition.id + '.REMAINING' | translate }}
      </li>
      <li id="policy-header-reset">
        <b id="policy-header-reset-name">{{ policy.headers.headerReset }}:</b>
        {{ 'POLICIES.' + policy.definition.id + '.RESET' | translate }}
      </li>
    </ul>
  </mat-card-content>
</mat-card>
